fix(test): correct the platform-tool allowlist — search_knowledge is real - #564
Merged
Merged
Conversation
…real The allowlist added in #557 guessed the platform tool set from what the `@objectstack/mcp@16.1.0` bridge happens to register, and got it wrong in both directions: - It omitted `search_knowledge`, so the guard would have FAILED a legitimate reference. The tool is real — it is in `PLATFORM_PROVIDED_TOOL_NAMES`, and 16.1.0 documented it all along at `spec/src/ai/knowledge-source.zod.ts:114` ("Whether `search_knowledge` may expose this source to AI agents"). One grep for that name would have caught it; the same absent-from-node_modules inference was applied to `visualize_data` and came out the other way. - It reasoned about deliberately excluding `create_record` / `update_record` / `delete_record`. Those are MCP-bridge tools and are not in the platform registry at all, so there was nothing to exclude. The list is now transcribed verbatim from `PLATFORM_PROVIDED_TOOL_NAMES` in `@objectstack/spec@17.0.0-rc.0` — all 30 entries, diffed equal to the upstream set — carrying instructions to delete the literal and import it on the 17.0 upgrade. A hand-copied registry is the drift risk this file exists to catch, one level up; it is a stopgap for 16.1.0, which exposes no such export. Cross-checked against upstream's own `ai-skill-tool-unresolved` rule, which ships in `@objectstack/lint@17.0.0-rc.0` (objectstack#3820). Both give identical verdicts on seven probes: `search_knowledge`, `query_data`, `todo_write` and `action_convert_lead` accepted; `action_escalate_case` (not `ai.exposed`), `search_knowledgebase` and `triage_case` rejected. Also corrects the "nothing defines it" claim in three places — the `customer_360` docstring, its changeset, and `code_examples.md`. The skill still does not reference the tool, for a narrower and accurate reason: retrieval needs a declared knowledge source, `AIKnowledgeSchema` mounts only on `AgentSchema.knowledge`, and #512 deleted the agents — so a skills-only app has nowhere to declare one and the tool would resolve and return nothing. The skill's instruction line now says the model has no such tool *in this skill*, rather than that none exists. 168 tests pass, typecheck and build clean, validate holds at its 2 pre-existing warnings. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y9STuduWbrAwcgviziaV4e
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
yinlianghui
marked this pull request as ready for review
July 31, 2026 03:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Corrects a bug I introduced in #557, plus the wrong premise it was built on.
The
PLATFORM_TOOLSallowlist intest/skills-integrity.test.tsguessed the platform tool set from what the@objectstack/mcp@16.1.0bridge happens to register. It was wrong in both directions:search_knowledge, so the guard would have failed a legitimate reference. The tool is real: it is inPLATFORM_PROVIDED_TOOL_NAMES, and 16.1.0 documented it all along atspec/src/ai/knowledge-source.zod.ts:114— "Whethersearch_knowledgemay expose this source to AI agents." One grep for that name would have caught it. The same absent-from-node_modulesinference was applied tovisualize_dataand came out the other way, which should have been the tell.create_record/update_record/delete_record. Those are MCP-bridge tools and are not in the platform registry at all — there was nothing to exclude.Type of Change
Related Issues
Related to #493, #512, #557, #561
Upstream: objectstack-ai/objectstack#3820
Changes Made
test/skills-integrity.test.ts— the allowlist is now transcribed verbatim fromPLATFORM_PROVIDED_TOOL_NAMESin@objectstack/spec@17.0.0-rc.0(all 30 entries, diffed equal to the upstream set), carrying instructions to delete the literal andimport { PLATFORM_PROVIDED_TOOL_NAMES } from '@objectstack/spec/system'on the 17.0 upgrade. A hand-copied registry is precisely the drift risk this file exists to catch one level up; it is a stopgap for 16.1.0, which exports no such set.src/skills/customer-360.skill.ts— docstring corrected. The skill still does not referencesearch_knowledge, but for an accurate and narrower reason (below). The instruction line now says the model has no such tool in this skill, rather than that none exists — the old wording was false to the model too..changeset/skills-undefined-tool-references.md(not yet consumed by a release) — the "nothing defines it" claim removed, so it does not ship into the changelog.docs/developers/code_examples.md— "Platform data tools" was an incomplete list presented as complete; now points at the registry as the source of truth and names the 17.0 export.Why the skill still leaves the tool out
search_knowledgeretrieves over a declared knowledge source.AIKnowledgeSchemamounts only onAgentSchema.knowledge— theindexes: [...]block — and #512 deleted the agents. A skills-only app has nowhere to declare a source, so the tool would resolve and return nothing. That is the same lie one layer down, socrm_knowledge_articleviaquery_recordsremains the right call. Worth revisiting if a stack-level knowledge source becomes declarable.Testing
npx vitest run) — 13 files, 168 passed / 2 skippedobjectstack validateholds at its 2 pre-existingcampaign_enrollmentwarningsDifferential check against the upstream rule
@objectstack/lint@17.0.0-rc.0shipsai-skill-tool-unresolved(the rule objectstack#3820 tracks). Installed the rc into a scratch tree and ran both it and this repo's guard over the same probes:search_knowledgequery_datatodo_writeaction_convert_leadaction_escalate_case(notai.exposed)search_knowledgebase(typo)triage_case(fictional)Identical verdicts on all seven. The upstream rule also reports 0 findings against the pre-#557 state — independent confirmation that removing
search_knowledgeas "undefined" was wrong.Checklist
.changeset/skills-platform-tool-allowlist-correction.md, patch)Additional Notes
One divergence found while cross-checking, worth carrying upstream if anyone picks up objectstack-ai/objectstack#3820: the upstream rule's
collectToolUniversecountsstack.toolsmetadata records as resolving, butToolSchemain 17.0 still describes itself as a[READ-ONLY PROJECTION — not an execution entry point]with no executor. A metadata-authored tool would satisfy the linter and still never run. This guard'sdoes not lean on AI tool metadatacase is stricter on that point and is kept.The 17.0 upgrade itself is deliberately not in this PR —
17.0.0-rc.0is a release candidate and bumping it touches the whole dependency tree. This change is dependency-neutral.🤖 Generated with Claude Code
https://claude.ai/code/session_01Y9STuduWbrAwcgviziaV4e
Generated by Claude Code